package com.code.day13;

import java.util.Scanner;

public class Day13LianXi {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String username = "root";
        String password = "root";
        for(int i = 0; i < 3; i++){
            System.out.println("请输入用户名:");
            String name = sc.next();
            System.out.println("请输入密码:");
            String pwd = sc.next();
            if(username.equals(name) && password.equals(pwd)){
                System.out.println("登陆成功");
                break;
            }else {
                if (i == 2) {
                    System.out.println("账号冻结");
                } else {
                    System.out.println("用户名或密码错误");
                }
            }
        }
    }
}
